package com.fishing.mapper;

import com.fishing.entity.Record;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RecordMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Record record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Record record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Record selectByPrimaryKey(Long id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Record record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Record record);

    List<Record> selectAll(@Param("roomId") Integer roomId,
                           @Param("startTime") String startTime,
                           @Param("endTime") String endTime,
                           @Param("pageIndex") Integer pageIndex,
                           @Param("pageCount") Integer pageCount);

    Integer selectCount();
}